@import "../style/index.scss";

@mixin workspaceItem {
  display: flex;
  flex: 1;
  cursor: pointer;
  padding: var(--default-spacing);
  gap: var(--default-spacing);
  min-width: 250px;

  &__name {
    @include regular-12;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    flex: 1;
    min-width: 0;
  }

  &__plan {
    font-size: 10px;
    color: var(--gray-30);
    color: var(--secondary);

    &.free {
      color: var(--secondary);
    }

    &.pro {
      color: var(--theme-blue);
    }

    &.enterprise {
      color: var(--theme-green);
    }
    &.essential {
      color: var(--theme-blue);
    }
  }

  &__details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    font-weight: 400;
  }
}

.workspaces-selector {
  position: relative;
  display: flex;

  width: 300px;
  &__current {
    width: calc(100% - var(--double-spacing));

    .amp-button {
      min-width: var(--button-min-width);

      .amp-icon {
        margin: 0;
      }
    }
  }

  &__list {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 40px;
    left: -1px;
    border: $border-dark;
    border-bottom-left-radius: var(--default-spacing-small);
    border-bottom-right-radius: var(--default-spacing-small);
    background-color: var(--gray-90);
    width: 100%;
    z-index: 1;

    &__item {
      @include workspaceItem;
      width: calc(100% - var(--double-spacing));
      margin-bottom: var(--icon-spacing);
      &__icon {
        color: var(--theme-green);
      }

      align-items: center;

      &:hover {
        background-color: var(--gray-70);
      }
    }

    &__button {
      i {
        padding: 2px;
      }
    }

    &__new {
      flex: 1;
      padding: var(--default-spacing);
    }

    &__divider {
      height: 1px;
      margin: 0 var(--default-spacing) var(--icon-spacing);
      background-color: var(--gray-50);
      border: none;
    }
  }
}
